package wator.view.swing;

import wator.model.AgentConfiguration;
import wator.view.swing.enums.AvailableColors;
import wator.view.swing.enums.ModelType;
import wator.view.swing.jogl.JoglDrawingStrategy;

/**
 * This object stores parameters for each agents needed for User interface.
 * 
 * @author Barbara Sepic
 *
 */
public class GraphicalAgentConfiguration {
	private AgentConfiguration agentConf;
	private ModelType model;
	private AvailableColors color;
	private JoglDrawingStrategy drawingStrategy;
	
	public GraphicalAgentConfiguration (AgentConfiguration agentConfiguration,
			ModelType model, AvailableColors color) {
		this.setAgentConf(agentConfiguration);
		//this.setModel(model);
		//this.setColor(color);
		
		//agentConf.getTemplate().setDrawingStrategy(strategy);
		//this.drawingStrategy = ...
	}
	
	public GraphicalAgentConfiguration (AgentConfiguration agentConfiguration,
			String model, String color) {
		this.agentConf = agentConfiguration;
		this.model = getModel(model);
		this.color = getColor(color);
	}
	
	private AvailableColors getColor(String color) {
		for (AvailableColors ac : AvailableColors.values()) {
			if (ac.name().equalsIgnoreCase(color)) {
				return ac;
			}
		}
		return null;
	}
	
	private ModelType getModel (String model) {
		for (ModelType mt : ModelType.values()) {
			if (mt.name().equalsIgnoreCase(model)) {
				return mt;
			}
		}
		return null;
	}

	public AgentConfiguration getAgentConf() {
		return agentConf;
	}

	public void setAgentConf(AgentConfiguration agentConf) {
		this.agentConf = agentConf;
	}

	public ModelType getModel() {
		return model;
	}

	public void setModel(ModelType model) {
		this.model = model;
	}

	public AvailableColors getColor() {
		return color;
	}

	public void setColor(AvailableColors color) {
		this.color = color;
	}
	
	
}
